\chapter{Difficulties}

The fist difficulty was to find a possibility to measure the time between two pulses. This was finally solved by a modified board that allowed to use the CCP1 port with the "capture"-feature.

The next task was to find the right balance between resolution of the measurement and overall size for the long time storage. As a bicycle computer has not to be very precise (two decimals after the comma are enough) the specifications were chosen as seen in \ref{sec:goalspecs} and then adapted to the available data types (see \ref{sec:outcomespecs}).

One programming task was the average speed. As the overall time- and distance counters are not updated at the same time a simple division isn't sufficient. An additional "puls"-counter solved the problem.  

The biggest computational task was the power computation. As this consists of a long equation with many variables and multiplications and divisions, numerical errors as well as the unit conversion were a challenge and probably due to some overflow don't result in anything realistic and are very sensitive to small speed changes even if they worked as expected in the tested cases in the MPLAB simulation.

\section{Outlook}

There are some things that could be still improved in order to get a better bicycle computer. The overall size of the components as it is known are probably not very handy to mount on a bike. The power consumption of the system could be lowered, for example by changing the system voltage to 3,3V. The detection of very low speeds is maybe not that important but is still an issue that could be improved. And then of course a better and working power calculation has to be found to make this feature working.

\section{What we learned}
The project was the first time programming something "bigger" on a microcontroller and showed all the limitations of such a device like programming memory and computational power. But still we saw that it is possible to implement it and create in this way a relatively cheap measurement system, that is sufficient for the given requirements.

 


